﻿namespace Model
{
    #region usings

    using System;

    using Common;

    #endregion

    public class Location : ICloneable<Location>
    {
        #region Properties

        public Guid Id { get; set; }

        public string Room { get; set; }

        #endregion

        #region Implemented Interfaces

        #region ICloneable<Location>

        public Location Clone()
        {
            return new Location { Id = Id, Room = Room };
        }

        #endregion

        #endregion

        public void Update(Location location)
        {
            if (Id != location.Id)
            {
                throw new InvalidOperationException("Locations with different id's could not be updated.");
            }

            Room = location.Room;
        }
    }
}